package io;

import com.sun.org.apache.xpath.internal.operations.Neg;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/8
 **/
public class OOSDemo {
    public static void main(String[] args) throws IOException {
        int age=15;
        String name="张三";
        String gender="男";
        String[]otherInfo={"是一名学生","山顶洞人","喜欢唱跳rap篮球","喜欢练习两年半"};
        Student zs = new Student(age,name,gender,otherInfo);
        System.out.println(zs);
        FileOutputStream fos = new FileOutputStream("student.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(zs);
        System.out.println("写入完毕");
    }
}
